/* ================================
   主页样式 - 干线协调优化平台
   ================================ */

/* 整体布局 */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* 防止水平滚动 */
    overflow-y: auto; /* 允许垂直滚动，但首页地图会覆盖此设置 */
    font-family: 'Segoe UI', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ================================
   顶部导航组件样式
   ================================ */

.layout-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(29, 43, 64, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(33, 150, 243, 0.3);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    animation: slideInDown 0.6s ease-out;
}

/* Logo区域 */
.layout-logo {
    font-size: var(--font-xl);
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    letter-spacing: 0.5px;
}

.layout-logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    font-size: 1.5em;
    color: var(--primary-green);
    transition: all var(--duration-normal) ease;
}

.layout-logo:hover .logo-icon {
    color: var(--accent-cyan);
    transform: rotate(10deg);
}

/* 弹性空间 */
.header-spacer {
    flex: 1;
}

/* 业务菜单 */
.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) ease;
    gap: var(--space-xs);
    position: relative;
}

.nav-item i {
    font-size: 1.2em;
    transition: transform var(--duration-normal) ease;
}

.nav-item span {
    font-size: var(--font-sm);
    font-weight: 500;
}

.nav-item:hover {
    color: var(--primary-green);
    background: rgba(76, 175, 80, 0.1);
    transform: translateY(-2px);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.1);
    border-bottom: 2px solid var(--accent-cyan);
}

/* ================================
   主内容区域
   ================================ */

.main-content {
    margin-top: 60px;
    height: calc(100vh - 60px);
    position: relative;
}

/* ================================
   地图容器样式
   ================================ */

.map-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    position: relative;
    overflow: hidden;
}

/* 首页特殊处理：地图页面禁用body滚动 */
body:has(.map-container) {
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ================================
   数据面板样式
   ================================ */

.data-panel {
    position: fixed;
    top: 60px;
    width: 320px;
    height: calc(100vh - 60px);
    background: rgba(29, 43, 64, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(33, 150, 243, 0.3);
    z-index: 1000;
    box-shadow: var(--shadow-2xl);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.left-panel {
    left: 0;
    border-right: 1px solid rgba(33, 150, 243, 0.3);
}

.right-panel {
    right: 0;
    border-left: 1px solid rgba(33, 150, 243, 0.3);
}

.data-panel.collapsed.left-panel {
    transform: translateX(-280px);
}

.data-panel.collapsed.right-panel {
    transform: translateX(280px);
}

.panel-header {
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    border-bottom: 1px solid rgba(33, 150, 243, 0.3);
    background: rgba(29, 43, 64, 0.8);
}

.left-panel .panel-header {
    justify-content: space-between;
}

.right-panel .panel-header {
    justify-content: space-between;
    flex-direction: row-reverse;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-base);
    font-weight: 600;
    color: white;
    margin: 0;
}

.panel-title i {
    color: var(--primary-green);
}

.panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-toggle:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.panel-content {
    height: calc(100% - 50px);
    overflow-y: auto;
    padding: var(--space-lg);
}

/* 地图内容区 */
.map-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a202c;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

/* ================================
   面板内容样式
   ================================ */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-green);
    transform: translateY(-1px);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(76, 175, 80, 0.2);
    color: var(--primary-green);
    font-size: var(--font-lg);
}

.stat-icon.success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--text-success);
}

.stat-icon.info {
    background: rgba(33, 150, 243, 0.2);
    color: var(--accent-blue);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: var(--font-lg);
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--space-xs);
}

.summary-section {
    margin-bottom: var(--space-xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-base);
    font-weight: 600;
    color: white;
    margin: 0 0 var(--space-md) 0;
}

.section-title i {
    color: var(--primary-green);
}

.tracking-summary,
.work-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.summary-item,
.work-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.summary-label,
.work-label {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.8);
}

.summary-value,
.work-value {
    font-size: var(--font-sm);
    font-weight: 600;
    color: white;
}

.summary-value.success,
.work-value.success {
    color: var(--text-success);
}

.summary-value.warning {
    color: var(--text-warning);
}

.work-value.info {
    color: var(--accent-blue);
}

.intersection-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.intersection-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-error);
}

.status-indicator.online {
    background: var(--text-success);
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}

.intersection-name {
    flex: 1;
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.9);
}

.efficiency-badge {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-success);
    background: rgba(76, 175, 80, 0.2);
    padding: 2px var(--space-xs);
    border-radius: var(--radius-sm);
}

.calc-status {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.8);
}

.progress-value {
    font-size: var(--font-sm);
    font-weight: 600;
    color: white;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--accent-cyan));
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

.calc-result {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.8);
}

.result-value {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--accent-cyan);
}

.scheme-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.scheme-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.scheme-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.scheme-status.implemented {
    background: var(--text-success);
}

.scheme-status.pending {
    background: var(--text-warning);
}

.scheme-info {
    flex: 1;
}

.scheme-name {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.scheme-time {
    font-size: var(--font-xs);
    color: rgba(255, 255, 255, 0.6);
}

.scheme-effect {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-success);
}

/* 地图错误提示 */
.map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: var(--space-2xl);
}

.map-error i {
    font-size: 4rem;
    color: var(--text-warning);
    margin-bottom: var(--space-lg);
    animation: pulse 2s infinite;
}

.map-error h3 {
    font-size: var(--font-xl);
    color: white;
    margin: 0 0 var(--space-md) 0;
}

.map-error p {
    font-size: var(--font-base);
    margin: var(--space-sm) 0;
    opacity: 0.8;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 信息窗口样式 */
.info-window {
    padding: var(--space-md);
    min-width: 200px;
}

.info-window h4 {
    color: var(--primary-green);
    margin: 0 0 var(--space-sm) 0;
    font-size: var(--font-base);
    font-weight: 600;
}

.info-window p {
    margin: var(--space-xs) 0;
    font-size: var(--font-sm);
    color: #333;
}

.info-window strong {
    color: #666;
}

/* ================================
   动画效果
   ================================ */

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================================
   响应式设计
   ================================ */

@media (max-width: 1024px) {
    .header-nav .nav-item span {
        display: none;
    }
}

@media (max-width: 768px) {
    .layout-logo .logo-text {
        display: none;
    }
    
    .header-nav {
        gap: var(--space-md);
    }
    
    /* 数据面板移动端适配 */
    .data-panel {
        width: 280px;
    }
    
    .data-panel.collapsed.left-panel {
        transform: translateX(-240px);
    }
    
    .data-panel.collapsed.right-panel {
        transform: translateX(240px);
    }
    
    .panel-header {
        padding: 0 var(--space-md);
    }
    
    .panel-content {
        padding: var(--space-md);
    }
    
    .stats-grid {
        gap: var(--space-sm);
    }
    
    .stat-item {
        padding: var(--space-sm);
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: var(--font-base);
    }
}
